"use strict";

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = (app) => {
  const { router, controller } = app;
  // 商品管理
  // 分类管理
  router.get("/admin/product/getCategory1", controller.product.categories.getCategory1);
  router.get("/admin/product/getCategory2/:category1Id", controller.product.categories.getCategory2);
  router.get("/admin/product/getCategory3/:category2Id", controller.product.categories.getCategory3);
  router.post("/admin/product/saveCategory1", controller.product.categories.saveCategory1);
  router.post("/admin/product/saveCategory2", controller.product.categories.saveCategory2);
  router.post("/admin/product/saveCategory3", controller.product.categories.saveCategory3);
  // 品牌管理
  router.get("/admin/product/baseTrademark/getTrademarkList", controller.product.trademarks.getAllTrademarkList);
  router.get("/admin/product/baseTrademark/:page/:limit", controller.product.trademarks.getTrademarkList);
  router.post("/admin/product/baseTrademark/save", controller.product.trademarks.saveTrademark);
  router.put("/admin/product/baseTrademark/update", controller.product.trademarks.updateTrademark);
  router.delete("/admin/product/baseTrademark/remove/:id", controller.product.trademarks.removeTrademark);
  // 上传图片
  router.post("/admin/product/upload", controller.product.upload.index);
  // 属性管理
  router.get("/admin/product/attrs/:category1Id/:category2Id/:category3Id", controller.product.attrs.getAttrList);
  router.post("/admin/product/attrs/save", controller.product.attrs.saveAttr);
  router.put("/admin/product/attrs/update", controller.product.attrs.updateAttr);
  router.delete("/admin/product/attrs/remove/:id", controller.product.attrs.removeAttr);
  // spu管理
  router.delete("/admin/product/spu/remove/:id", controller.product.spu.removeSpu);
  router.get("/admin/product/spu/spuImageList/:spuId", controller.product.spu.getSpuImageList);
  router.get("/admin/product/spu/:page/:limit", controller.product.spu.getSpuList);
  router.post("/admin/product/spu/save", controller.product.spu.saveSpu);
  router.put("/admin/product/spu/update", controller.product.spu.updateSpu);
  // 销售属性管理
  router.get("/admin/product/baseSaleAttrList", controller.product.saleAttrs.getBaseSaleAttrList);
  router.post("/admin/product/baseSaleAttr/save", controller.product.saleAttrs.saveBaseSaleAttr);
  router.get("/admin/product/spuSaleAttrList/:spuId", controller.product.saleAttrs.getSpuSaleAttrList);
  // sku管理
  router.get("/admin/product/sku/:skuId", controller.product.sku.getSkuBySkuId);
  router.get("/admin/product/findSkuListBySpuId/:spuId", controller.product.sku.findSkuListBySpuId);
  router.get("/admin/product/sku/:page/:limit", controller.product.sku.getSkuList);
  router.post("/admin/product/sku/save", controller.product.sku.saveSku);
  router.put("/admin/product/sku/update", controller.product.sku.updateSku);
  router.delete("/admin/product/sku/remove/:id", controller.product.sku.removeSku);
  router.put("/admin/product/isSale/:skuId/:isSale", controller.product.sku.updateIsSale);
  // 权限管理
  // 用户管理

  // 角色管理

  // 菜单管理
};
